﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace CodeTunnel.MvcUtilities.Validators
{
    /// <summary>
    /// Validation attribute for URLs.
    /// </summary>
    public class UrlAttribute : RegularExpressionAttribute
    {
        /// <summary>
        /// Call base constructor and pass in URL regular expression.
        /// </summary>
        public UrlAttribute()
            : base(@"(http://|)(www\.)?([^\.]+)\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$") { }
    }
}
    